/*******************************************
 * Copyright 2007 Aphrodite Framework for javaME .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * Email : owner@aphroditeme.dev.java.net
 * Contributors:
 *     Kent Elton - initial API and implementation
 *******************************************/

package com.aphrodite.ui.bg;

import javax.microedition.lcdui.Graphics;

import com.aphrodite.ui.graphics.GraphicUtil;

/**
 * Renders a semi transparent color background
 * 
 * @author kentelt
 * 
 */
public class TranslucentBackground extends Background {
	int alphaLevel;
	int color;

	/**
	 * 
	 * @param color
	 * @param alphaLevel
	 *            The transparency between 0 (fully transparent) and 255 (fully
	 *            opaque)
	 */
	public TranslucentBackground(int color, int alphaLevel) {
		// super(0, 0, 0, 0, true);
		super();
		this.color = color;
		this.alphaLevel = alphaLevel;
	}

	public void render(Graphics g) {
		g.setColor(color);
		GraphicUtil.fillRect(g, alphaLevel, x, y, width, height);

	}

}
